app.controller('fenleisanCtrl',function  ($scope,$state,$http) {
	console.log($state.params)
	
	$('.bar_span').each(function(ins) {
		$(this).click(function() {
			//		console.log(ins)
			$(this).addClass('color').parents().siblings().children().removeClass('color')
		})
	})
	
	$scope.backBtn = function  () {
	window.history.back()
    }
	
	$scope.fenleisancontent_aaa = 111
	
	function fenleisanShow() {
		$http.get('/api/api', {
			params: {
				client: {
					"ageGroup": "AG_0to24",
					"channel": "QD_web_webkit",
					"deviceId": "0",
					"gender": "0",
					"imei": "0",
					"packageName": "com.culiu.purchase",
					"platform": "wap",
					"sessionId": "0",
					"shopToken": "0",
					"userId": "0",
					"version": "1.0",
					"xingeToken": ""
				},
				query: $state.params.message
			}
		}).then(function(res) {
					console.log(res)
			$scope.fenleisancontent = res.data
			

		})
		
	}
	
	
	fenleisanShow()
	
	
	$scope.fenleisancontentShow1 = function  () {
			$scope.fenleisancontent_aaa = 111
			fenleisanShow()
			
		}
		
		
		
		$scope.fenleisancontentShow2 = function  () {
			$scope.fenleisancontent_aaa = 222
			
			
			$http.get('/api/api', {
			params: {
				client: {
					"ageGroup": "AG_0to24",
					"channel": "QD_web_webkit",
					"deviceId": "0",
					"gender": "0",
					"imei": "0",
					"packageName": "com.culiu.purchase",
					"platform": "wap",
					"sessionId": "0",
					"shopToken": "0",
					"userId": "0",
					"version": "1.0",
					"xingeToken": ""
				},
				query: $state.params.message,
				sort:'soldQuantity_desc'
			}
		}).then(function(res) {
//					console.log(res)
			$scope.fenleisancontent2 = res.data
			
		})
			
			
		}
		
		
		$scope.fenleisancontentShow3 = function  () {
			
			$scope.fenleisancontent_aaa = 333
			
			$http.get('/api/api', {
			params: {
				client: {
					"ageGroup": "AG_0to24",
					"channel": "QD_web_webkit",
					"deviceId": "0",
					"gender": "0",
					"imei": "0",
					"packageName": "com.culiu.purchase",
					"platform": "wap",
					"sessionId": "0",
					"shopToken": "0",
					"userId": "0",
					"version": "1.0",
					"xingeToken": ""
				},
				query: $state.params.message,
				sort:"addtime_desc"
			}
		}).then(function(res) {
//					console.log(res)
			$scope.fenleisancontent3 = res.data
			
		})
			
		}
		
		
		$scope.fenleisancontentShow4 = function  () {
			$scope.fenleisancontent_aaa = 444
			
			$http.get('/api/api', {
			params: {
				client: {
					"ageGroup": "AG_0to24",
					"channel": "QD_web_webkit",
					"deviceId": "0",
					"gender": "0",
					"imei": "0",
					"packageName": "com.culiu.purchase",
					"platform": "wap",
					"sessionId": "0",
					"shopToken": "0",
					"userId": "0",
					"version": "1.0",
					"xingeToken": ""
				},
				query: $state.params.message,
				sort:"price_asc"
			}
		}).then(function(res) {
//					console.log(res)
			$scope.fenleisancontent4 = res.data
			
		})
			
		}
	
	
	
	
	
	
})